package com.kingyun.gpsinspection.purificationservice.facade.service.tdm;

import com.kingyun.gpsinspection.purificationservice.facade.model.File;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;


public interface TdmFileService {
    /**
     * 上传图片
     * @param request
     * @param filename
     * @return
     * @throws Exception
     */
    String[] uploadImg(HttpServletRequest request, String filename) throws Exception;

    /**
     * 保存附件
     * @param id
     * @param filenames
     * @param fileHbasePath
     * @return
     * @throws Exception
     */
    int insertFile(String id, String[] filenames, String[] fileHbasePath) throws Exception;

    /**
     * 根据ID查询附件
     * @param fileId
     * @return
     * @throws Exception
     */
    File queryById(String fileId) throws Exception;

    /**
     * 根据业务ID查询附件的集合
     * @param businessId
     * @return
     * @throws Exception
     */
    List<File> queryByBusinessId(String businessId) throws Exception;

    /**
     * 根据主键ID删除
     * @param fileId
     * @return
     * @throws Exception
     */
    int delById(String fileId) throws Exception;

    /**
     * 根据业务ID删除
     * @param businessId
     * @return
     * @throws Exception
     */
    int delByBusinessId(String businessId) throws Exception;

    /**
     * 根据HbasePath删除
     * @param fileHbasePath
     * @return
     * @throws Exception
     */
    int delByFileHbasePath(String fileHbasePath) throws Exception;

    /**
     * 根据业务ID和trait查询
     * @param map
     * @return
     */
    List<File> queryByBusinessIdTrait(Map map);
}
